package com.rub.android

import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.ViewPropertyAnimatorListener
import com.rub.android.base.BaseActivity
import com.rub.android.MainActivity
import com.rub.android.R
import kotlinx.android.synthetic.main.activity_splash.*

class SplashActivity: BaseActivity(), ViewPropertyAnimatorListener {
    override fun getLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun onAnimationStart(view: View?) {
    }

    override fun onAnimationCancel(view: View?) {
    }
    override fun onAnimationEnd(view: View?) {
        //进入主界面
        /*startActivity<MainActivity>()
        finish()*/
        startActivityAndFinish<MainActivity>()
    }


    override fun initView() {
        ViewCompat.animate(imageView).scaleX(1.0f).scaleY(1.0f).setListener(this).duration = 2000
    }
}